'''
Created on 2011-9-29

@author: leo
'''
import threading
import urllib2
import time
from log import log
class timer(threading.Thread):
    def __init__(self, url, data):  
        threading.Thread.__init__(self)  
        self.url = url
        self.data = data
        self.thread_stop = False  
    def run(self): 
        while not self.thread_stop:  
            for i in range(0,28,1):
                time.sleep(60)
            urllib2.urlopen(self.url, self.data)
            log("ReLogin")
    def stop(self):  
        self.thread_stop = True  